package com.example.user.controller;

import com.example.user.common.R;
import com.example.user.entity.Stock;
import com.example.user.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author JFeng
 * @Date 2024/5/21
 */

@RequestMapping("/stock")
@RestController
public class StockController {

    @Autowired
    private StockService stockService;

    @RequestMapping("/reduce")
    public R<Stock> reduce(@RequestParam Integer productId) {
//        int a = 1 / 0;
        return stockService.reduce(productId);
    }
}
